package 一维数组;

public class Demo4 {
    public static void main(String[] args) {
        int[] arr=new int[5];
        System.out.print("存储数据到arr之前[");
        for (int i = 0; i < arr.length; i++){
            if (arr[i]==0){
                System.out.print(arr[i]);
            }else {
                System.out.print(","+arr[i]);
            }
        }
        System.out.print("]");
        for (int i = 0; i < arr.length; i++){
            arr[i]=i+2;
        }
        System.out.print("存储数据到arr之后[");
        for (int i = 0; i < arr.length; i++){
            if (arr[i]==2){
                System.out.print(arr[i]);
            }else {
                System.out.print(","+arr[i]);
            }
        }
        System.out.print("]");
    }
}
